package com.stu.covid.business.mapper;

import com.stu.covid.business.entity.Student;
import com.stu.covid.business.entity.StudentHealth;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
public interface StudentHealthMapper extends Mapper<StudentHealth> {

    List<StudentHealth> list(StudentHealth studentHealth);

    Integer count(StudentHealth studentHealth);

    @Select("select IFNULL(AVG(temperature) ,0) from t_student_health where DATE_FORMAT(health_date,'%Y-%m-%d') = #{value}")
    String selectHealthAvg(String date);
}